A telecommunications service is generally a computing network-intensive application, and there are a quite large number of overheads of software and hardware interrupt processing used by a CPU to process packet sending and receiving of a network interface card (for example, a 512-byte UDP packet is received and sent on a gigabit network interface card at a fixed rate of 300 Mbps, and overheads of software and hardware interrupt processing of the gigabit network interface card may reach 30% of single-core CPU usage).
In a physical machine scenario, for a multi-core processor, when and on which CPU interrupt processing of a network interface card runs can be controlled by setting affinity binding between an interrupt of a physical network interface card and a physical CPU. In this way, a telecommunications service program can precisely control an interrupt processing policy of the network interface card as required, so as to avoid unpredictable interference to running of the service program.
With continuous promotion of a concept of cloud computing, running a telecommunications service on a virtual machine has become a general trend. To meet requirements of reliability and predictability of running the telecommunications service on the virtual machine, a virtualization platform also needs to be capable of precisely controlling the interrupt processing policy of the network interface card, so as to avoid unpredictable interference to running of a service program and a program of an adjacent virtual machine that shares a physical machine with the virtual machine.
As shown in FIG. 1, after a virtual machine is introduced, interrupt packet sending and receiving processing of a virtual network interface card (VNIC, Virtual Network Interface Card) is divided into two stages: First, a physical interrupt of the virtual network interface card sends a packet to a host operating system (Host Operating System, Host OS) that runs on a physical machine; then, the Host OS distributes the packet to the virtual machine (Virtual Machine, VM) so as to trigger a virtual interrupt of the virtual network interface card, and then a guest operating system (Guest Operating System, Guest OS) that runs on the virtual machine processes packet sending and receiving of the virtual interrupt of the virtual network interface card. In a process of transfer from the physical interrupt of the virtual network interface card to the virtual interrupt of the virtual network interface card, there is no fixed correspondence by default for a physical CPU to which the physical interrupt of the virtual network interface card sends the packet for processing, and a virtual CPU to which the virtual interrupt of the virtual network interface card sends the packet for processing, and there is no fixed correspondence between a physical CPU and a virtual CPU either.
If there is no definite scheduling policy for interrupt packet sending and receiving processing of the virtual network interface card, impact of the interrupt packet sending and receiving of the virtual network interface card cannot be predicted in a virtual machine environment. As shown in FIG. 2, it is assumed that an application 3 (Application 3, APP3) of a VM1 is a process responsible for network packet sending and receiving and runs on a VCPU3 (Virtual Central Processing Unit, virtual central processing unit), and that the VCPU3 is scheduled to run on a PCPU3 (Physical Central Processing Unit, physical central processing unit 3). If there is no definite policy control, packet sending and receiving processing of a physical interrupt that is of the virtual network interface card and corresponding to the APP3 may occur on a PCPU2, and packet sending and receiving processing of a virtual interrupt of the virtual network interface card may occur on a VCPU1, and consequently, interference is caused respectively to an APP2 that runs on a VCPU2 and an APP1 that runs on the VCPU1. In addition, if there is no definite policy control on packet sending and receiving of the physical and virtual interrupts of the virtual network interface card, it is also likely to cause adjacent interference between VMs that share a physical machine. As shown in FIG. 2, it is assumed that an APP5 of a VM2 is a process responsible for network packet sending and receiving and runs on a VCPU5, and the VCPU5 is scheduled to run on a PCPU5, corresponding physical interrupt processing of the physical network interface card may be on a PCPU4, and interference is caused to an APP4 of the VM1.
For a telecommunications system, because there are a large number of overheads of software and hardware interrupt processing of a network interface card, the overheads of the software and hardware interrupt processing of the network interface card need to be precisely controlled, so that it is implemented that interrupt packet sending and receiving processing of a network interface card between virtual machines that share a physical machine does not interfere with each other, and within a virtual machine, it needs to be implemented that interrupt processing of a network interface card in the virtual machine imposes no interference between VCPUs.